Add InternVL3-8B-Instruct contrib model#153
Open
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
Open
Add InternVL3-8B-Instruct contrib model#153jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
jimburtoft wants to merge 1 commit intoaws-neuron:mainfrom
Conversation
InternVL3-8B-Instruct VLM (vision-language model) for Neuron inference via NeuronBaseForImageToText framework. Architecture: InternViT-300M vision encoder + pixel shuffle MLP projector + Qwen2.5-7B text backbone (~8B total parameters). Validated on trn2.3xlarge (LNC=2, TP=4) with SDK 2.29: - logit_validation passes with BF16-appropriate tolerances - 75.1 tok/s (BS=1, seq_len=2048), 1.85x vs L40S GPU - Text-only and multimodal inference supported Includes compile script, src/ modeling code (3 files), and integration tests using torch_neuronx logit_validation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: The below template includes items meant for model contributions only. For other contributions such as bug fixes, features, etc., only fill out the relevant portions of the form.
Description
InternVL3-8B-Instruct VLM (vision-language model) for Neuron inference via the NeuronBaseForImageToText framework. Architecture: InternViT-300M vision encoder + pixel shuffle MLP projector + Qwen2.5-7B text backbone (~8B total parameters, BF16).
Validated on trn2.3xlarge (LNC=2, TP=4) with logit_validation passing, 75.1 tok/s text generation, and end-to-end multimodal inference.
Model Information
Model Name: InternVL3-8B-Instruct
Model Architecture: Vision-language model (InternViT-300M encoder + Qwen2.5-7B decoder)
Purpose: Multimodal text generation (image-to-text, visual question answering, text-only chat)
Checklist
Please ensure your PR includes the following items. Refer to the contrib/CONTRIBUTING.md for detailed guidelines.
Required Components
Accuracy Test (ex.
test/integration/test_model.py)torch_neuronx.testing.validation.logit_validationgenerate_expected_logits, compares against Neuron BF16 outputREADME.md with the following sections:
pytest test/integration/test_model.py -v --tb=shortSource Code (
src/)modeling_internvl3.py: Top-level VLM (NeuronBaseForImageToText)modeling_internvl3_text.py: Text backbone (Qwen2.5-7B with vision embedding injection)modeling_internvl3_vision.py: Vision encoder (InternViT-300M, torch_neuronx.trace)Optional Components
test/unit/__init__.pyexists (placeholder for future tests)Folder Structure
Confirm your contribution follows this structure:
Testing
How did you test this change?
All tests run on trn2.3xlarge (LNC=2, TP=4) with Neuron SDK 2.29.
compile_internvl3_vlm.py(text CTE+TKG + vision encoder NEFFs)test_model.pyruns:test_config: Validates InternVL3 config matches expected Qwen2.5-7B architecture (7 assertions)test_text_logit_validation: CPU FP32 reference logits (16 tokens) compared against Neuron BF16 vialogit_validation()with per-tier tolerancesTest Results:
Compatibility
Tested with:
Additional Information
torch_neuronx.trace()with--auto-cast=matmult -O1. 34.5ms per 448x448 tile.Related Issues
N/A
vLLM Integration
vLLM integration requires patches to vllm-neuron's model loader to register the InternVL3 architecture. See README for details.
By submitting this PR, I confirm that: